
<div id="foodarticle-add-edit">

    <div class="title">
        修改食材百科
    </div>

    <div class="content">

        <form action="__APP__/FoodArticle/update" method="post">

            <input type="hidden" name="image" class="pic" value="<{$data.image}>" readonly="readonly" />
            <input type="hidden" name="id" value="<{$data.id}>" />
            <table>

                <tr>
                    <th>所属栏目：</th>

                    <td>

                        <select name="sectionid" class="foodsectionid">
                            <option value="0">---请选择所属栏目---</option>
                            <volist name="foodsection" id="vo">
                                <eq name="data.sectionid" value="$vo.id">
                                        <option value="<{$vo.id}>" selected="selected"><{$vo.name}></option>
                                    <else/>
                                        <option value="<{$vo.id}>"><{$vo.name}></option>
                                </eq>
                            </volist>
                        </select>　

                        <strong>所属分类：</strong>
                        <select name="categoryid" class="foodcategoryid">
                            <option value="0" selected="selected">---请选择所属分类---</option>
                            <volist name="foodcategory" id="vo">
                                <eq name="data.categoryid" value="$vo.id">
                                    <option value="<{$vo.id}>" selected="selected"><{$vo.name}></option>
                                    <else/>
                                    <option value="<{$vo.id}>"><{$vo.name}></option>
                                </eq>
                            </volist>
                        </select>　

                    </td>

                </tr>

                <tr>
                    <th>食材名称：</th><td><input type="text" class="text" name="name" value="<{$data.name}>" /></td>
                </tr>

                <tr>
                    <th>食材别名：</th><td><input type="text" class="text" name="alias" value="<{$data.alias}>" /></td>
                </tr>

                <tr>
                    <th>
                        是否发布：
                    </th>
                    <td>
                        <eq name="data.publish" value="1">
                                <input type="radio" checked="checked" name="publish" value="1" />是
                                <input type="radio" name="publish" value="0" />否　
                            <else/>
                                <input type="radio"  name="publish" value="1" />是
                                <input type="radio" checked="checked" name="publish" value="0" />否　
                        </eq>
                        <strong>排序：</strong>
                        <input style="width:200px;" type="text" class="text" name="sort" value="0" />　
                        <strong>旺季：</strong>
                        <eq name="data.onseason" value="1">
                                <input type="checkbox" checked="checked" style="position: relative;top:3px;" name="onseason" value="1" />　
                            <else/>
                                <input type="checkbox" style="position: relative;top:3px;" name="onseason" value="1" />　
                        </eq>

                    </td>
                </tr>
                <tr>
                    <th class="top"><a href="javascript:;" class="upload">上传图片：</a></th>
                    <td style="height:210px;" class="img">
                        <empty name="data.image">
                                <img width="208" height="208" style="float: left;" src="__PUBLIC__/Content/FoodArticle/default.jpg" />
                            <else/>
                                <img width="208" height="208" style="float: left;" src="__PUBLIC__/Content/FoodArticle/<{$data.image}>" />
                        </empty>
                        <div class="unit">
                            <p><strong>请选择该食材所用单位,并填写对应单位的初始克数</strong><input type="button" class="selectall" style="margin-left: 5px;" name="" value="全选/取消" /></p>
                            <ul>
                                    <volist name="fooddealinfo" id="vo">
                                            <li>
                                                <input type="checkbox" name="unit[]" checked="checked" value="<{$vo.unit}>" />
                                                <span style="margin-left: 5px;width:50px;">1 <{$vo.setdeal.name}>&nbsp;&nbsp;=></span>
                                            <span style="float: right;margin-right: 10px;">
                                                <input type="text" name="deal[]" value="<{$vo.deal}>" />g
                                            </span>
                                            </li>
                                    </volist>
                                <volist name="dealinfo" id="vo">
                                    <li><input type="checkbox" name="unit[]" value="<{$vo.id}>" /><span style="margin-left: 12px;width:50px;">1 <{$vo.name}>&nbsp;&nbsp;=></span><span style="float: right;margin-right: 10px;"><input type="text" disabled="disabled" name="deal[]" value="0" />g</span></li>
                                </volist>
                            </ul>
                        </div>
                    </td>
                </tr>
                <tr><th class="top">食材描述：</th><td><textarea name="description" class="textarea" ><{$data.description}></textarea></td></tr>
                <tr><th></th><td><input type="submit" class="submit" value="修改食材" />　　<input type="reset" value="清空重填" /></td></tr>

            </table>

        </form>

    </div>
</div>
<script type="text/javascript" src="../Public/js/foodarticle.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ajaxupload.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/kindeditor/kindeditor-min.js"></script>
<script>
    var editor;
    KindEditor.ready(function(K) {
        editor = K.create('textarea[name="description"]', {
            langType : 'en',
            newlineTag : 'br',
            resizeType : 0,
            allowPreviewEmoticons : false,
            allowImageUpload : true,
            minHeight : 350,
            pasteType : 1,
            filterMode : true,
            items : [
                'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'hello','|', 'fullscreen']
        });
    });
</script>
